﻿// Copyright (c) egmkang wang. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace XServer.Config
{
    public abstract class IConfig<TKey>
    {
        public virtual TKey ID { get; }
        /// <summary>
        /// true表示检查有错误
        /// false表示没有错误
        /// </summary>
        public virtual bool CheckError()
        {
            return false;
        }
    }

    public abstract class IConfigWithIntKey : IConfig<int>
    {
        [ConfigElement(Element = "id")]
        public int id;
        public override int ID => id;
    }

    public abstract class IConfigWithStringKey : IConfig<string>
    {
        [ConfigElement(Element = "id")]
        public string id;
        public override string ID => id;
    }
}
